﻿using System.Data;
namespace Codemonk.Common.Data
{
    /// <summary>
    /// 执行sql不返回结果
    /// </summary>
    public interface IExecuteNonQueryable
    {
        int ExecuteNonQuery(IDbCommand cmd, IDbTransaction tran = null);

        int ExecuteNonQuery(string cmdtext, params IDataParameter[] paras);

        int ExecuteNonQuery(string cmdtext, DbParameterBuilder builder);

        int ExecuteNonQuery<T>(string cmdtext, DbParameterBuilder<T> builder) where T : IDataParameter, new();

        int ExecuteNonQuery(string cmdtext, IDbTransaction tran = null, params IDataParameter[] paras);

        int ExecuteNonQuery(string cmdtext, DbParameterBuilder builder, IDbTransaction tran = null);

        int ExecuteNonQuery<T>(string cmdtext, DbParameterBuilder<T> builder, IDbTransaction tran = null) where T : IDataParameter, new();

        int ExecuteNonQuery(string cmdtext, CommandType cmdtype = CommandType.Text, IDbTransaction tran = null, params IDataParameter[] paras);

        int ExecuteNonQuery(string cmdtext, DbParameterBuilder builder, CommandType cmdtype = CommandType.Text, IDbTransaction tran = null);

        int ExecuteNonQuery<T>(string cmdtext, DbParameterBuilder<T> builder, CommandType cmdtype = CommandType.Text, IDbTransaction tran = null) where T : IDataParameter, new();

        int ExecuteNonQuery(IDbConnection connection, string cmdtext, params IDataParameter[] paras);

        int ExecuteNonQuery(IDbConnection connection, string cmdtext, DbParameterBuilder builder);

        int ExecuteNonQuery<T>(IDbConnection connection, string cmdtext, DbParameterBuilder<T> builder) where T : IDataParameter, new();

        int ExecuteNonQuery(IDbConnection connection, string cmdtext, IDbTransaction tran = null, params IDataParameter[] paras);

        int ExecuteNonQuery(IDbConnection connection, string cmdtext, DbParameterBuilder builder, IDbTransaction tran = null);

        int ExecuteNonQuery<T>(IDbConnection connection, string cmdtext, DbParameterBuilder<T> builder, IDbTransaction tran = null) where T : IDataParameter, new();

        int ExecuteNonQuery(IDbConnection connection, string cmdtext, CommandType cmdtype = CommandType.Text, IDbTransaction tran = null, params IDataParameter[] paras);

        int ExecuteNonQuery(IDbConnection connection, string cmdtext, DbParameterBuilder builder, CommandType cmdtype = CommandType.Text, IDbTransaction tran = null);

        int ExecuteNonQuery<T>(IDbConnection connection, string cmdtext, DbParameterBuilder<T> builder, CommandType cmdtype = CommandType.Text, IDbTransaction tran = null) where T : IDataParameter, new();
    }
}
